<html><head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8"><title>ShortcutGadget</title></head>
<body bgcolor="#FFFFDF" link="#009999" vlink="#006666" alink="#006666">
<font face="Arial" size="2"><p align="center"><b><font size="4">ShortcutGadget()</font></b></p>
<p><b>Syntax</b></p><blockquote>

Result = <font color="#006666"><b>ShortcutGadget</b></font>(#Gadget, x, y, Width, Height, Shortcut)</blockquote>

</blockquote>
<b>Description</b><br><blockquote>



Creates a gadget for keyboard shortcut selection in the current GadgetList. The user can select it 
and hold down a keyboard combination to select a new shortcut. 

 

</blockquote><p><b>Parameters</b></p><blockquote>
<style type="text/css">
table.parameters { border-spacing: 0px; border-style: none; border-collapse: collapse; }
table.parameters td { border-width: 1px; padding: 6px; border-style: solid; border-color: gray; vertical-align: top; font-family:Arial; font-size:10pt; }
</style>
<table width="90%" class="parameters">
<tr><td width="10%"><i>#Gadget</i></td>
<td width="90%"> 
 
A number to identify the new gadget. <a href="../reference/purebasic_objects.html">#PB_Any</a> can 
be used to auto-generate this number. 

 

</td></tr>
<tr><td><i>x, y, Width, Height</i></td>
<td> 
 
The position and dimensions of the new gadget. 

 

</td></tr>
<tr><td><i>Shortcut</i></td>
<td> 
 
The initial shortcut to display. The possible values are the same as in the 
<a href="../window/addkeyboardshortcut.html">AddKeyboardShortcut()</a> function. A value of 0 can be used to 
indicate that no shortcut is currently set. 

 

</td></tr>
</table>
</blockquote><p><b>Return value</b></p><blockquote>



Returns nonzero on success and zero on failure. If <font color="#924B72">#PB_Any</font> was used as the #Gadget parameter 
then the return-value is the auto-generated gadget number on success. 

 

</blockquote><p><b>Remarks</b></p><blockquote>



A 'mini help' can be added to this gadget using <a href="gadgettooltip.html">GadgetToolTip()</a>. 
<br>
<br>
The following functions can be used to act on a ShortcutGadget: 
<br>
<br>
- <a href="getgadgetstate.html">GetGadgetState()</a>: Get the currently selected keyboard shortcut. 
<br>
- <a href="setgadgetstate.html">SetGadgetState()</a>: Change the currently selected keyboard shortcut. 

 

</blockquote><p><b>Example</b></p><blockquote>

<pre><font face="Courier New, Courier, mono"size="2">  <b><font color="#006666">If</font></b> <font color="#006666">OpenWindow</font>(0, 0, 0, 240, 70, "ShortcutGadget", <font color="#924B72">#PB_Window_SystemMenu</font> | <font color="#924B72">#PB_Window_ScreenCentered</font>)
<font color="#006666">    ShortcutGadget</font>(0, 20, 20, 200, 25, <font color="#924B72">#PB_Shortcut_Control</font> | <font color="#924B72">#PB_Shortcut_A</font>)
    <b><font color="#006666">Repeat</font></b>
      Event =<font color="#006666"> WaitWindowEvent</font>()
    <b><font color="#006666">Until</font></b> Event = <font color="#924B72">#PB_Event_CloseWindow</font>
  <b><font color="#006666">EndIf</font></b>
</font></pre>

</blockquote><p><b>See Also</b></p><blockquote>

<a href="getgadgetstate.html">GetGadgetState()</a>, <a href="setgadgetstate.html">SetGadgetState()</a>, <a href="../window/addkeyboardshortcut.html">AddKeyboardShortcut()</a> 

</Blockquote><p><b>Supported OS  </b><Blockquote>All</Blockquote></p><center>&lt;- <a href=setgadgettext.html>SetGadgetText()</a> - <a href=index.html>Gadget Index</a> - <a href=spingadget.html>SpinGadget()</a> -&gt;



</body></html>